
import Vue from 'vue'
import VueRouter from 'vue-router'


const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Manager',
    redirect:'login',
    component:()=>import('../views/ManagerView.vue'),
    children:[
      {path:'user',name:'User',meta:{name:'用户信息'} ,component:()=>import('../views/Manager/UserView.vue')},
      {path:'home',name:'Home',meta:{name:'主页'} ,component:()=>import('../views/Manager/HomeView.vue')},
      {path: '/person',name: 'Person',meta:{name:'个人信息'} ,component:()=>import('../views/Manager/PersonView.vue')},
      {path: '/admin',name: 'Admin',meta:{name:'管理员信息'} ,component:()=>import('../views/Manager/admin.vue')},
      {path: '/sendNovel',name: 'Novel',meta:{name:'发布文章'} ,component:()=>import('../views/Manager/novelView.vue')},
      {path: '/novelList',name: 'NovelList',meta:{name:'文章列表'} ,component:()=>import('../views/Manager/NovelList.vue')},
      {path: '/albums',name: 'Albums',meta:{name:'相册管理'} ,component:()=>import('../views/Manager/albumsView.vue')},
      {path: '/logs',name: 'Logs',meta:{name:'系统日志'} ,component:()=>import('../views/Manager/logsView.vue')},
      {path: '/photo',name: 'Photo',meta:{name:'相册'} ,component:()=>import('../views/Manager/photoVue.vue')},
      {path: '/notice',name: 'notice',meta:{name:'系统公告'} ,component:()=>import('../views/Manager/NoticeView.vue')},
      {path: '/test',name: 'Test',meta:{name:'系统公告'} ,component:()=>import('../views/Manager/TestView.vue')},
      {path: '/novelContent',name: 'novelContent',meta:{name:'文章详情'} ,component:()=>import('../views/Manager/novelContent.vue')},
      {path: '/commend',name: 'Commend',meta:{name:'评论管理'} ,component:()=>import('../views/Manager/commendVue.vue')},
      {path: '/message',name: 'Message',meta:{name:'留言管理'} ,component:()=>import('../views/Manager/MessageVue.vue')},
    ]
  },

  {
    path: '/test',
    name: 'test',
    component:()=>import('../views/Manager/TestView.vue')
  },
  {
    path: '/login',
    name: 'Login',
    meta:{name:'系统首页'} ,
    component:()=>import('../views/LoginView.vue')
  },
  {
    path: '/register',
    name: 'Register',
    meta:{name:'系统首页'} ,
    component:()=>import('../views/RegisterView.vue')
  },
 
]


const router = new VueRouter({
  routes
})

export default router
